home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/ports.h>
- #include <exec/memory.h>
- #include <dos/dos.h>
- #include <clib/exec_protos.h>
- #include <clib/alib_protos.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include "MultiChat.h"
- #include <doorheader.h>
- #include "ChatMsg.h"
-
- UWORD DeleteChatPort(void)
- {
- struct MsgPort *ChatPort;
- struct ChatMsgStruct *ChatMsg;
-
- extern char *PortNames[];
- char YourNode_char[200];
- char Buf[100];
-
- UWORD NodeNr;
-
-
- getuserstring(YourNode_char, BB_NODEID);
- NodeNr = atoi(YourNode_char);
-
- if (ChatMsg = (struct ChatMsgStruct *)AllocMem(sizeof(struct ChatMsgStruct), MEMF_ANY | MEMF_CLEAR))
- {
- ChatPort = FindPort(PortNames[NodeNr]);
-
- while (ChatMsg = (struct ChatMsgStruct *)GetMsg(ChatPort))
- ReplyMsg((struct Message *)ChatMsg);
- DeletePort(ChatPort);
-
- FreeMem(ChatMsg, sizeof(struct ChatMsgStruct));
- }
- else
- {
- sprintf(Buf, "Couldn't allocate memory for msg structure.\r\n");
- sendmessage(Buf, 0);
- }
- return(TRUE);
- }
-
-